package com.huohuzhihui.member.service.impl;

import com.huohuzhihui.member.domain.MemberRecharge;
import com.huohuzhihui.member.mapper.MemberMapper;
import com.huohuzhihui.member.mapper.MemberRechargeMapper;
import com.huohuzhihui.member.service.IMemberRechargeService;
import com.huohuzhihui.member.vo.AccRechargeChartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * 账户充值Service业务层处理
 * 
 * @author huohuzhihui
 * @date 2021-03-16
 */
@Service
public class MemberRechargeServiceImpl implements IMemberRechargeService
{
    @Autowired
    private MemberRechargeMapper accRechargeMapper;
    @Autowired
    private MemberMapper accUserAccountMapper;
    /**
     * 查询账户充值
     * 
     * @param id 账户充值ID
     * @return 账户充值
     */
    @Override
    public MemberRecharge selectAccRechargeById(Long id)
    {
        return accRechargeMapper.selectAccRechargeById(id);
    }

    /**
     * 查询账户充值列表
     * 
     * @param accRecharge 账户充值
     * @return 账户充值
     */
    @Override
    public List<MemberRecharge> selectAccRechargeList(MemberRecharge accRecharge)
    {
        return accRechargeMapper.selectAccRechargeList(accRecharge);
    }

    @Override
    public int insertAccRecharge(MemberRecharge accRecharge) {
        return 0;
    }


    /**
     * 修改账户充值
     * 
     * @param accRecharge 账户充值
     * @return 结果
     */
    @Override
    public int updateAccRecharge(MemberRecharge accRecharge)
    {
        return accRechargeMapper.updateAccRecharge(accRecharge);
    }

    /**
     * 批量删除账户充值
     * 
     * @param ids 需要删除的账户充值ID
     * @return 结果
     */
    @Override
    public int deleteAccRechargeByIds(Long[] ids)
    {
        return accRechargeMapper.deleteAccRechargeByIds(ids);
    }

    /**
     * 删除账户充值信息
     * 
     * @param id 账户充值ID
     * @return 结果
     */
    @Override
    public int deleteAccRechargeById(Long id)
    {
        return accRechargeMapper.deleteAccRechargeById(id);
    }

    @Override
    public BigDecimal getTotalAmount(MemberRecharge accRecharge) {
        return accRechargeMapper.getTotalAmount(accRecharge);
    }

    @Override
    public List<AccRechargeChartVo> getCurrentMothOrder() {
        return accRechargeMapper.getCurrentMothOrder();
    }
}
